//
//  DCFUserModel.m
//  DCF
//
//  Created by 吴文拼 on 2017/12/26.
//  Copyright © 2017年 吴文拼. All rights reserved.
//

#import "DCFUserModel.h"

@implementation DCFUserModel

-(instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        self.userId = (dic[@"id"]&&![dic[@"id"] isEqual:[NSNull null]])?dic[@"id"]:@0;
        self.mobile = (dic[@"mobileNum"]&&![dic[@"mobileNum"] isEqual:[NSNull null]])?dic[@"mobileNum"]:@"";
        self.token = (dic[@"token"]&&![dic[@"token"] isEqual:[NSNull null]])?dic[@"token"]:@"";
        self.headUrl = (dic[@"headUrl"]&&![dic[@"headUrl"] isEqual:[NSNull null]])?dic[@"headUrl"]:@"";
        self.userName = (dic[@"userName"]&&![dic[@"userName"] isEqual:[NSNull null]])?dic[@"userName"]:@"";
    }
    return self;
}


-(NSDictionary *)getJsonDic{
    NSMutableDictionary *mutDic = [NSMutableDictionary dictionary];
    [mutDic setObject:self.userId forKey:@"id"];
    [mutDic setObject:self.mobile forKey:@"mobileNum"];
    [mutDic setObject:self.token forKey:@"token"];
    [mutDic setObject:self.userName forKey:@"userName"];
    [mutDic setObject:self.headUrl forKey:@"headUrl"];
    return mutDic;
}



@end
